package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;
import java.util.List;

@TableName("t_mainPost")
public class MainPostBean {
    @TableId(value = "pk_mainPostId", type = IdType.AUTO)
    private Integer id;
    @TableField("m_title")
    private String title;
    @TableField("m_author")
    private String author;
    @TableField("m_content")
    private String content;
    @TableField("m_date")
    private LocalDate date = LocalDate.now();
    @TableField(exist = false)
    private Integer count;
    @TableField("fk_channelId")
    private Integer channelId;
    @TableField("fk_userId")
    private Integer userId;
    @TableField(exist = false)
    private List<RepliesBean> repliesBeanList;
    @TableField(exist = false)
    private UserBean userBean;

    public MainPostBean() {
    }

    public MainPostBean(String title, String author, String content, LocalDate date, Integer channelId) {
        this.title = title;
        this.author = author;
        this.content = content;
        this.date = date;
        this.channelId = channelId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Integer getChannelId() {
        return channelId;
    }

    public void setChannelId(Integer channelId) {
        this.channelId = channelId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public List<RepliesBean> getRepliesBeanList() {
        return repliesBeanList;
    }

    public void setRepliesBeanList(List<RepliesBean> repliesBeanList) {
        this.repliesBeanList = repliesBeanList;
    }

    public UserBean getUserBean() {
        return userBean;
    }

    public void setUserBean(UserBean userBean) {
        this.userBean = userBean;
    }

    @Override
    public String toString() {
        return "MainPostBean{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", content='" + content + '\'' +
                ", date=" + date +
                ", count=" + count +
                ", channelId=" + channelId +
                ", userId=" + userId +
                ", repliesBeanList=" + repliesBeanList +
                ", userBean=" + userBean +
                '}';
    }
}
